package ysq.xyg.util;

import com.cloopen.rest.sdk.CCPRestSmsSDK;

import java.util.HashMap;

/**
 * 短信
 *
 * @author taocongcong
 * @create 2018-09-01 10:58
 */
public class SmsSampleUtil {

    public static HashMap<String, Object> signPush(String phone, String verifyCode){
        HashMap<String, Object> result = null;
        //初始化SDK
        CCPRestSmsSDK restAPI = new CCPRestSmsSDK();
        restAPI.init("sandboxapp.cloopen.com", "8883");
        String cloopenAccountSid = ProProperties.getInstance().getCloopenAccountSid();
        String cloopenAuthToken = ProProperties.getInstance().getCloopenAuthToken();
        String cloopenAppId = ProProperties.getInstance().getCloopenAppId();
        restAPI.setAccount(cloopenAccountSid, cloopenAuthToken);
        restAPI.setAppId(cloopenAppId);
        //*假设您用测试Demo的APP ID，则需使用默认模板ID 1，发送手机号是13800000000，传入参数为6532和5，则调用方式为           *
        //*result = restAPI.sendTemplateSMS("13800000000","1" ,new String[]{"6532","5"});																		  *
        result = restAPI.sendTemplateSMS(phone, "1" ,new String[]{verifyCode,"1"});
        return result;
    }

}
